Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmd] Add Scheduled command decorator #7083

Open
wants to merge 44 commits into
base: main
Choose a base branch
from

Conversation

narmstro2020
Copy link
Contributor

This seemed to be missing as most of the other commands have a decorator.

I'm struggling a bit with the C++

@narmstro2020 narmstro2020 requested a review from a team as a code owner September 15, 2024 03:03
Copy link
Contributor

This PR modifies commands. Please open a corresponding PR in Python Commands and include a link to this PR.

@narmstro2020 narmstro2020 changed the title [WPICommand] Add Scheduled command decorator [wpilibNewCommands] Add Scheduled command decorator Sep 15, 2024
@narmstro2020
Copy link
Contributor Author

/format

@narmstro2020
Copy link
Contributor Author

/format

@narmstro2020
Copy link
Contributor Author

/format

@narmstro2020
Copy link
Contributor Author

/format

@calcmogul calcmogul changed the title [wpilibNewCommands] Add Scheduled command decorator [cmd] Add Scheduled command decorator Sep 16, 2024
@narmstro2020
Copy link
Contributor Author

How is this one looking?

@narmstro2020
Copy link
Contributor Author

/format

@spacey-sooty
Copy link
Contributor

You have to do this as a seperate overload as the logic internally will be different

@narmstro2020
Copy link
Contributor Author

You have to do this as a seperate overload as the logic internally will be different

It's the internal logic that I'm struggling with. I've posted the initial setup, but I'm not sure how to join m_ptr to the vector argument.

@narmstro2020
Copy link
Contributor Author

/format

@Starlight220
Copy link
Member

I feel like accepting additional commands here messes up the semantics a bit. fork feels like it should be a unary operator (akin to asProxy), not a binary one.

For the few cases that need a multi-command ScheduleCommand, a static factory (or even the constructor) should serve with more fitting semantics.

@narmstro2020
Copy link
Contributor Author

I feel like accepting additional commands here messes up the semantics a bit. fork feels like it should be a unary operator (akin to asProxy), not a binary one.

For the few cases that need a multi-command ScheduleCommand, a static factory (or even the constructor) should serve with more fitting semantics.

So more like Commands.fork() instead of command.fork() ?

@narmstro2020
Copy link
Contributor Author

I feel like accepting additional commands here messes up the semantics a bit. fork feels like it should be a unary operator (akin to asProxy), not a binary one.

For the few cases that need a multi-command ScheduleCommand, a static factory (or even the constructor) should serve with more fitting semantics.

So make it a static method not an instance method?

@KangarooKoala
Copy link
Contributor

I feel like accepting additional commands here messes up the semantics a bit. fork feels like it should be a unary operator (akin to asProxy), not a binary one.

For the few cases that need a multi-command ScheduleCommand, a static factory (or even the constructor) should serve with more fitting semantics.

My interpretation of this is that there should be command.fork() (without any args) and Commands.fork(commands...), though I'd like to hear confirmation from @Starlight220.

@Starlight220
Copy link
Member

My interpretation of this is that there should be command.fork() (without any args) and Commands.fork(commands...)

Yes, that's what I meant.

@narmstro2020
Copy link
Contributor Author

Okay

My interpretation of this is that there should be command.fork() (without any args) and Commands.fork(commands...)

Yes, that's what I meant.

I gotcha. I'll have to change the robotpy version too. Somehow it's already been merged

@narmstro2020
Copy link
Contributor Author

/format

@narmstro2020
Copy link
Contributor Author

/format

@narmstro2020
Copy link
Contributor Author

I'm not sure what the cpp error is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants